﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SLP
{
    [Serializable]
    public class Item : INotifyPropertyChanged
    {
        string _name;
        public string Name
        {
            get { return _name; }
            set { if (value != null && _name != value) { _name = value; OnChanged("Name"); } }
        }

        string _path;
        public string Path
        {
            get { return _path; }
            set { if (value != null && _path != value) { _path = value; OnChanged("Path"); } }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// To support INotifyPropertyChanged events
        /// </summary>
        /// <param name="PropertyName">Name of property that changed</param>
        public void OnChanged(string PropertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(PropertyName));
        }
    }
}
